{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/vb/anaconda3/lib/python3.7/site-packages/matplotlib/__init__.py:846: MatplotlibDeprecationWarning: \n",
      "The text.latex.unicode rcparam was deprecated in Matplotlib 2.2 and will be removed in 3.1.\n",
      "  \"2.2\", name=key, obj_type=\"rcparam\", addendum=addendum)\n",
      "/Users/vb/anaconda3/lib/python3.7/site-packages/matplotlib/__init__.py:855: MatplotlibDeprecationWarning: \n",
      "examples.directory is deprecated; in the future, examples will be found relative to the 'datapath' directory.\n",
      "  \"found relative to the 'datapath' directory.\".format(key))\n",
      "/Users/vb/anaconda3/lib/python3.7/site-packages/matplotlib/__init__.py:947: UserWarning: could not find rc file; returning defaults\n",
      "  warnings.warn(message)\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import numpy.linalg as npl\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4.1,2 Clustering & A Clustering Objective"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1. \"The goal of clustering is to group of partition vectors into k groups or clusters, with the vectors in each group close to each other\"\n",
    "2. Objective: A single value used to judge \"choice of clustering\": choose k"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2.0, 1.3333333333333333)"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#given a tuple of vectors, and representatives for groups of vectors,\n",
    "#what is the average distance each vector has from a representative\n",
    "\n",
    "x = np.array([[0,1],[1,0],[-1,1]])\n",
    "reps = np.array([[1,1],[0,0]])\n",
    "\n",
    "jclust = lambda x, reps, assignment: np.average([npl.norm(x[i] - reps[assignment[i]])**2 for i in range(len(x))])\n",
    "jclust(x,reps,[0,1,0]),jclust(x,reps,[0,0,1]) #assignments are 0 indexed\n",
    "\n",
    "#How can we select the center-most (most minimal distance between vectors)\n",
    "#representative?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4.3 k-Means Algorithm"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\"Iterating between choosing group representatives and choosing group assignments\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Pseduo:\n",
    "1. Initialize a group of representatives either by: 1) randomly selecting from set of vectors, or 2) randomly group vectors and create mean vectors to be used as representatives.\n",
    "2. Partition vectors in k amount of groups. Assign a group for every vector associated with the nearest representative.\n",
    "    If there are any ties for vector assignments, choose the group with the smallest j value of the ties.\n",
    "    If there is an empty group, remove from list of k groups.\n",
    "    If there are two iterations without changes in vector assignments, stop algorithm.\n",
    "3. Update representatives. For every group from 1-k set the corresponding representative to be the mean of the vectors in that group.\n",
    "    If Jclust gets small, stop algorithm."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 296,
   "metadata": {},
   "outputs": [],
   "source": [
    "def kmeans(x,k,maxiters = 100, tolerance = 1e-4):\n",
    "    \n",
    "    N = len(x) #amount of vectors\n",
    "    n = len(x[0]) #dimension of each vector\n",
    "    distances = np.zeros(N) #stores distances of each pt to nearest rep\n",
    "    progress = [] #used to visualize J updates\n",
    "    jPrev = np.Infinity #placeholder for ending condition: \n",
    "                        #if previous J and current J haven't changed much,finish\n",
    "    \n",
    "    reps = [np.zeros(n) for j in range(k)] #stores representatives\n",
    "    assignment = [np.random.randint(k) for i in range(N)] #intializes a random assignment of N integers between 0 and k\n",
    "    \n",
    "    for itr in range(maxiters):\n",
    "        for j in range(k):\n",
    "            group = [i for i in range(N) if assignment[i] == j]\n",
    "            reps[j] = sum(x[group]/len(group))\n",
    "        for i in range(N):\n",
    "            #(distance and index):\n",
    "            (distances[i], assignment[i]) = np.amin([npl.norm(x[i] - reps[j]) for j in range(k)]),[npl.norm(x[i] - reps[j]) for j in range(k)].index(np.amin([npl.norm(x[i] - reps[j]) for j in range(k)]))\n",
    "        J = (npl.norm(distances)**2) / N\n",
    "        progress.append([J,itr])\n",
    "        print(\"Iteration \" + str(itr) + \": Jclust = \" + str(J)+\".\")\n",
    "        if (itr > 1) and (abs(J-jPrev) < (tolerance * J)):\n",
    "            return assignment, reps, progress\n",
    "        \n",
    "        jPrev = J  \n",
    "    return assignment, reps, progress"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 297,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = np.concatenate(\n",
    "    [[.3*np.random.randn(2) for i in range(100)],\n",
    "     [np.array([1,1]) + .3*np.random.randn(2) for i in range(100)],\n",
    "     [np.array([1,-1]) + .3*np.random.randn(2) for i in range(100)]]\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 298,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((-1.5, 2.5), (-2, 2))"
      ]
     },
     "execution_count": 298,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJztnX+QHGd557/PrsZoZIhXxgKssdY2OcfCQrEWbdlKfJVCDkHGxvbGwhaOIZCDUnEXklhxVBEHhY3LKYuoiLkcXIjzo0IKn5FAsAjsnIBYFHe+kw/Ju0LIlhLxS9ZIhxfsVcA7tmd3n/tjpkc9Pe/b/fZ0T0/P7PdTpdqZ7ne6n3m1+z79Pj9FVUEIIYQMdFsAQggh+YAKgRBCCAAqBEIIIXWoEAghhACgQiCEEFKHCoEQQgiAFBSCiKwQkX0i8rSIHBGRPzKMERH5SxE5LiLfFZE3Jb0vIYSQdFmUw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x7WtV9TRQ++UB8BrLuMUickBE9otIVkrDZX4aY7QWunwGwKszkc4gQx3b/+PGuungiyKywnC+2+Th99GVXxORQyLyTyKyqpuC1M2UIwCeCJzK1XyGyAnEnM80axlF4lIGw4FrVPWUiLwGtfyHo/Unj9RIQc5Y5TraJUzOGJcZrs/n6wE8JiKHVfX76UhoxWV+MpnDCFxk+CqAh1X1JRH5AGq7mms7Llk88jCXLjwJ4GJV/YWIXA9gHMBl3RBERF4JYDeAO1X134KnDR/pynxGyBl7PjNVCBpRBsPxGqfqP58VkS+jtq1PVSGkIGcm5TrC5BSRn4jIhap6ur6dfdZyDW8+fyAi30LtSaPTCsFlfrwxJ0VkEYDzkL25IVJOVf2Z7+3fAPh4BnLFpSfKx/gXNFV9VET+m4hcoKqZFpMTkQJqi+xDqvolw5BczGeUnO3MZ0+ZjETkXBF5lfcawFsB5LEaah7KdewB8J766/cAaNnZiMhSEXlF/fUFAK4B8FQGsrnMj1/+dwB4TOuesgyJlDNgO74JNVtu3tgD4Hfr0THrAJzxzIl5QkRe5/mJROQq1Nann4V/KnUZBMDfAXhaVf/CMqzr8+kiZ1vzmbV3PMRr/tuoad6XAPwEwN768eUAHq2/fj1qkR6HABxBzYSTOzn1bCTCv6D2tN0NOV8N4J8B/Gv95/n146MA/rb++tcBHK7P52EA78tQvpb5AXAvanWxAGAxgC8AOA7g/wJ4fZd+L6PkvL/+u3gIwD4AK7sg48MATgOo1n833wfgAwA+UD8vqDWp+n79/9kaxddlOT/om8v9AH69CzL+e9TMP98FMFn/d33e5tNRztjzydIVhBBCAPSYyYgQQkjnoEIghBACgAqBEEJIHSoEQgghAKgQCCGE1KFCIIQQAoAKgRBCSJ3/DzfxBF+220HwAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter([x[0] for x in X],[x[1] for x in X])\n",
    "plt.xlim([-1.5,2.5]),plt.ylim([-2,2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 300,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Iteration 0: Jclust = 1.0231693716582628.\n",
      "Iteration 1: Jclust = 0.5918779423265886.\n",
      "Iteration 2: Jclust = 0.5278468679981483.\n",
      "Iteration 3: Jclust = 0.5269656523989839.\n",
      "Iteration 4: Jclust = 0.5269656523989839.\n"
     ]
    }
   ],
   "source": [
    "k=2\n",
    "assignment, reps, progress = kmeans(X,k)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 301,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((-1.5, 2.5), (-2, 2))"
      ]
     },
     "execution_count": 301,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJztnXuUHVW957+/NB04IpNOICrkgejkgjwCkR5AcbnEOLxECChBdFQUzGLU6xWVZRxdkcvyLkCW4Hj1XoziUmcAiRpCFBxQwOWMM2FsHkmIgMTHhSSMRENHIMek0/nNH1XVXafO3rt2napTp+r097NWr3Sf2qfqd3a692/v31NUFYQQQsi0XgtACCGkGlAhEEIIAUCFQAghJIQKgRBCCAAqBEIIISFUCIQQQgAUoBBEZJ6IPCAij4vIJhH5B8MYEZGvishmEdkgIq/P+1xCCCHFsl8B99gL4FOq+rCIHATgIRH5mar+JjbmLAALwq+TAfxr+C8hhJCKkPuEoKrPqurD4fcvAHgcwJzEsPMAfE8D1gEYEpFD8z6bEEJIcRRxQphARF4NYBGABxOX5gB4JvbzlvC1Zw33WAZg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b/PicgdCI71hSqEAuQspVyHS04R+ZOIHKqqz4bH2ecs94jm8/ci8gsEO41uKwSf+YnGbBGR/QDMQPnmhlQ5VfUvsR+/CeC6EuTKSi3Kx8QXNFW9W0T+RUQOUdVSi8mJyCCCRfYWVV1tGFKJ+UyTs5P5rJXJSEQOFJGDou8BnA6gitVQq1CuYy2AD4TffwBA28lGRGaKyP7h94cAOBXAb0qQzWd+4vK/C8D9GnrKSiRVzoTt+FwEttyqsRbA+8PomFMA7IzMiVVCRF4V+YlE5CQE69Nf3O8qXAYBcDOAx1X1Bsuwns+nj5wdzWfZ3nGH1/x8BJp3N4A/AbgnfP0wAHeH378GQaTHegCbEJhwKienTkYi/BbBbrsXch4M4D4AT4X/zgpfHwbwrfD7NwLYGM7nRgCXlihf2/wAuBpBXSwAOADADwBsBvB/AbymR7+XaXJeE/4urgfwAICjeiDjbQCeBTAW/m5eCuByAJeH1wVBk6rfhf/P1ii+Hsv5sdhcrgPwxh7I+CYE5p8NAB4Nv86u2nx6ypl5Plm6ghBCCICamYwIIYR0DyoEQgghAKgQCCGEhFAhEEIIAUCFQAghJIQKgRBCCAAqBEIIISH/H1M2G0LYxNwxAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "groups = [[X[i] for i in range(len(X)) if assignment[i] == j] for j in range(k)]\n",
    "plt.scatter([c[0] for c in groups[0]],[c[1] for c in groups[0]])\n",
    "plt.scatter([c[0] for c in groups[1]],[c[1] for c in groups[1]])\n",
    "plt.xlim([-1.5,2.5]),plt.ylim([-2,2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 302,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Iteration 0: Jclust = 0.9317054287555512.\n",
      "Iteration 1: Jclust = 0.31389848409835014.\n",
      "Iteration 2: Jclust = 0.17439737829953222.\n",
      "Iteration 3: Jclust = 0.16861472349202722.\n",
      "Iteration 4: Jclust = 0.16861472349202722.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "((-1.5, 2.5), (-2, 2))"
      ]
     },
     "execution_count": 302,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJztnXuUHVWd77+/7nToJkh3kGhCJxlhBkGEYKBXyAhkCXjDIw6JPBJwxoFRb5b36oiMwzJgBnuxGAnDGh3m6oxmRtfg8kEij4SZMJOo4ELxxmtCHhghGtGB7jQShW4l6SSd7t/941R116mzd9WuU3Xq1Dn9/bB69TlV+9T+nUqzf7V/T1FVEEIIIS31FoAQQkgxoEIghBACgAqBEEKIBxUCIYQQAFQIhBBCPKgQCCGEAMhAIYjIHBF5UkSeE5E9InKLYYyIyD+KyD4R2S0i56WdlxBCSLZMyeAaxwB8QlWfEZE3ANguIt9W1Z8GxlwJ4HTv5wIA/+z9JoQQUhBS7xBUdUBVn/Fe/x7AcwC6Q8OWAviqltgKoEtEZqWdmxBCSHZksUMYR0TeAmA+gB+FTnUDeCnwvs87NmC4xkoAKwFg2rRp55955plZikgIIU3N9u3bf6OqM6r5bGYKQUROAPAwgI+r6u/Cpw0fMdbMUNW1ANYCQE9Pj27bti0rEQkhpOkRkf+u9rOZRBmJSBtKyuDrqvqIYUgfgDmB97MB7M9ibkIIIdmQRZSRAPgygOdU9bOWYY8B+HMv2mghgCFVrTAXEUIIqR9ZmIwuBPB+AM+KyE7v2B0A5gKAqn4RwOMArgKwD8AhAH+RwbyEEEIyJLVCUNUfwOwjCI5RAB9JOxchhJDawUxlQ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BzD+XpThL9HV/5YRHaJyH+KyNvrKYhnppwP4EehU4W6nxFyAgnvZ5a1jGJxKYPhwIWqul9E3oRS/sPz3pNHZmQgZ6JyHdUSJWeCy8z17udpAJ4QkWdV9RfZSGjF5f7kcg9jcJHh3wF8U1WPiMiHUdrVXFpzyZJRhHvpwjMA/kBVXxeRqwBsAHB6PQQRkRMAPAzg46r6u/Bpw0fqcj9j5Ex8P3NVCBpTBsPxGvu936+IyKMobeszVQgZyJlLuY4oOUXk1yIyS1UHvO3sK5Zr+PfzBRH5HkpPGrVWCC73xx/TJyJTAHQif3NDrJyq+tvA238BcG8OciWlIcrHBBc0VX1cRP5JRE5W1VyLyYlIG0qL7NdV9RHDkELczzg5q7mfDWUyEpFpIvIG/zWAxQCKWA21COU6HgNwk/f6JgAVOxsRmS4ix3mvTwZwIYCf5iCby/0Jyn8dgCfU85TlSKycIdvx1SjZcovGYwD+3IuOWQhgyDcnFgkRmen7iURkAUrr02+jP5W5DALgywCeU9XPWobV/X66yFnV/czbOx7hNX8vSpr3CIBfA9jsHT8FwOPe69NQivTYBWAPSiacwsmpE5EIP0Ppabsecr4RwHcB/Nz7fZJ3vAfAv3qv3wngWe9+PgvggznKV3F/ANyFUl0sAGgH8C0A+wD8PwCn1envMk7Oe7y/xV0AngRwZh1k/CaAAQAj3t/mBwF8GMCHvfOCUpOqX3j/ztYovjrL+dHAvdwK4J11kPEilMw/uwHs9H6uKtr9dJQz8f1k6QpCCCEAGsxkRAghpHZQIRBCCAFAhUAIIcSDCoEQQggAKgRCCCEeVAiEEEIAUCEQQgjx+P9RkHMYGspDJwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "k=3\n",
    "assignment, reps, progress = kmeans(X,k)\n",
    "groups = [[X[i] for i in range(len(X)) if assignment[i] == j] for j in range(k)]\n",
    "plt.scatter([c[0] for c in groups[0]],[c[1] for c in groups[0]])\n",
    "plt.scatter([c[0] for c in groups[1]],[c[1] for c in groups[1]])\n",
    "plt.scatter([c[0] for c in groups[2]],[c[1] for c in groups[2]])\n",
    "plt.xlim([-1.5,2.5]),plt.ylim([-2,2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 306,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Iteration 0: Jclust = 0.8987095782460353.\n",
      "Iteration 1: Jclust = 0.1916676983729594.\n",
      "Iteration 2: Jclust = 0.14917398347157398.\n",
      "Iteration 3: Jclust = 0.14856605711398402.\n",
      "Iteration 4: Jclust = 0.14847310770120947.\n",
      "Iteration 5: Jclust = 0.14837893204001054.\n",
      "Iteration 6: Jclust = 0.1483607928113771.\n",
      "Iteration 7: Jclust = 0.1483607928113771.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "((-1.5, 2.5), (-2, 2))"
      ]
     },
     "execution_count": 306,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJztnX+UXWV5779PZiaZIdEZkACTXxXaFII0mjALUGpU4uWnMchv7LVQ9WZ5K22glpoEhYit/FpLpFdbTdWrXbdCIgIhDZYoqKgt1gAhCAGJ0Uoyg0RhJiWZIZmZ5/5x9j6zzz7vu/e7z95nn33OfD9rzZpz9n7Pfp+zM3mf/T4/RVVBCCGETGm0AIQQQooBFQIhhBAAVAiEEEI8qBAIIYQAoEIghBDiQYVACCEEQAYKQUTmisj3RGSHiDwtIisNY0RE/l5EdorIdhFZnHZeQggh2dKewTVGAXxMVR8XkdcBeExEvqOqzwTGnAN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vStv6TBVCBnLmUq4jSk4R+Y2I9KrqgLedfclyDf9+7hKR76P0pFFvheByf/wxu0WkHUA38jc3xMqpqr8LvP0nALfkIFdSmqJ8THBBU9UHROQfRORIVc21mJyIdKC0yP6Lqt5jGFKI+xknZy33s6lMRiIyXURe578GcCaAIlZDLUK5jvsBXOG9vgJA1c5GRA4XkWne6yMBnA7gmRxkc7k/QfkvAvCwep6yHImVM2Q7fi9KttyicT+AP/WiY04DMOSbE4uEiBzj+4lE5BSU1qffRX8qcxkEwFcA7FDVz1qGNfx+ushZ0/3M2zse4TV/H0qa9zUAvwHwoHd8FoAHvNfHoRTp8SSAp1Ey4RROTp2IRPg5Sk/bjZDzDQAeAvC89/sI73gfgC97r98G4Cnvfj4F4EM5yld1fwDciFJdLADoBPBNADsB/CeA4xr0dxkn503e3+KTAL4H4IQGyHgngAEAh7y/zQ8B+AiAj3jnBaUmVb/w/p2tUXwNlvOqwL18FMDbGiDjH6Nk/tkOYJv3c27R7qejnInvJ0tXEEIIAdBkJiNCCCH1gwqBEEIIACoEQgghHlQIhBBCAFAhEEII8aBCIIQQAoAKgRBCiMf/B4ZGikjwnDXiAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "k=4\n",
    "assignment, reps, progress = kmeans(X,k)\n",
    "groups = [[X[i] for i in range(len(X)) if assignment[i] == j] for j in range(k)]\n",
    "plt.scatter([c[0] for c in groups[0]],[c[1] for c in groups[0]])\n",
    "plt.scatter([c[0] for c in groups[1]],[c[1] for c in groups[1]])\n",
    "plt.scatter([c[0] for c in groups[2]],[c[1] for c in groups[2]])\n",
    "plt.scatter([c[0] for c in groups[3]],[c[1] for c in groups[3]])\n",
    "plt.xlim([-1.5,2.5]),plt.ylim([-2,2])\n",
    "# plt.show()\n",
    "# plt.scatter([i[1] for i in progress],[i[0] for i in progress])\n",
    "# plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4.4 Examples"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4.5 Applications"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
